<?php
// +----------------------------------------------------------------------
// | tpadmin [a web common based ThinkPHP5]
// +----------------------------------------------------------------------
// | Copyright (c) 2016 tianpian
// +----------------------------------------------------------------------
// | Author: tianpian <tianpian0805@gmail.com>
// +----------------------------------------------------------------------

//------------------------
// 自定义配置信息 英文版
//-------------------------

return [
    //端口类型
    'en'=>[
        1=>'this is english version'
    ],
    'client' => [
		1 => 'pc',
		2 => 'wx',
		3 => 'app',
		4 => 'h5',
	],
	'extend_types' => [
		'text' => '文本',
        'switch' => '开关',
		'number' => '数字',
		'date' => '日期',
		'dateRange' => '日期区间',
		'checkbox' => '复选',
		'radio' => '单选',
		'image' => '图片',
	],
	//业务模块配置
    'business_type' => [
        1 => ['type'=>'product','is_unique'=>'0','events'=>'EVENT_TYPE_PRODUCT_DETAIL,EVENT_TYPE_PRODUCT_BUY,EVENT_TYPE_PRODUCT_COLLECT,EVENT_TYPE_PRODUCT_COMMENT,EVENT_TYPE_PRODUCT_HISTORY,EVENT_TYPE_PRODUCT_ADD_CART','db'=>'product','model_name'=>'产品管理'],
        2 => ['type'=>'article','is_unique'=>'0','events'=>'EVENT_TYPE_ARTICLE_DETAIL,EVENT_TYPE_ARTICLE_COLLECT,EVENT_TYPE_ARTICLE_COMMENT,EVENT_TYPE_ARTICLE_HISTORY,EVENT_TYPE_ARTICLE_DETAIL','db'=>'article_list','model_name'=>'文章管理'],
        3 => ['type'=>'link','is_unique'=>'0','events'=>'EVENT_TYPE_LINK_DETAIL,EVENT_TYPE_LINK_COLLECT,EVENT_TYPE_LINK_COMMENT,EVENT_TYPE_LINK_HISTORY,EVENT_TYPE_LINK_DETAIL','db'=>'link','model_name'=>'链接管理'],
        4 => ['type'=>'member','is_unique'=>'1','events'=>'','tag_config'=>'member','db'=>'member','model_name'=>'会员管理'],
        5 => ['type'=>'album','is_unique'=>'0','events'=>'EVENT_TYPE_ALBUM_DETAIL,EVENT_TYPE_ALBUM_COLLECT,EVENT_TYPE_ALBUM_COMMENT,EVENT_TYPE_ALBUM_HISTORY,EVENT_TYPE_ALBUM_DETAIL','db'=>'album','model_name'=>'相册管理'],
        6 => ['type'=>'shop','is_unique'=>'1','events'=>'','db'=>'shop','model_name'=>'商城管理'],
        7 => ['type'=>'sms','is_unique'=>'1','events'=>'','db'=>'sms','model_name'=>'短信管理'],
        8 => ['type'=>'credit','is_unique'=>'1','events'=>'','origin_module'=>'4','tag_config'=>'credit_field,credit_login_field,credit_signin_field','db'=>'product','model_name'=>'积分管理'],
        9 => ['type'=>'form','is_unique'=>'0','events'=>'EVENT_TYPE_FROM_COMMENT,EVENT_TYPE_FROM_SHARE','db'=>'form','model_name'=>'表单管理'],
        10 => ['type'=>'forum'],
        12 => ['type'=>'assemble'],
    ],
	'business_tags' =>[
		'credit_field'=>['fields_config'=>'is_open_credit,is_shopping_interaction,credit_name,credit_consumer_name,credit_interaction_name,credit_is_shopping,credit_scale,credit_is_register,credit_is_login,credit_is_signin,credit_login_send,credit_signin_send','name'=>'积分配置'],
		'credit_login_field' => ['fields_config'=>'credit_login_days,credit_login_extra','登录赠送积分配置'],
		'credit_signin_field' => ['fields_config'=>'credit_signin_days,credit_signin_extra','签到赠送积分配置'],
		'member'=>['fields_config'=>'is_open_register,is_open_login,retrieve_password_way,register_check_way,pic_captcha_type,login_check_way,login_error_times_limit,email_code_valid,mobile_code_valid,is_open_pay_password,address_limit','name'=>'会员配置']
	],
	//业务模块字段配置汇总
	'business_fields_config' => [
		//<<<common
        'sms_code' => [
            'name'=>'sms code',
            'type'=>'number',
            'vals'=>'',
            'relation_business'=>'7',
            'default_val'=>''
        ],
        'mobile_code_valid' => [
            'name'=>'mobile code valid',
            'type'=>'number',
            'vals'=>'',
            'relation_business'=>'4,7',
            'default_val'=>10,
            'unit'=>'min',
            'order'=>98
        ],
        'email_code_valid' => [
            'name'=>'email code valid',
            'type'=>'number',
            'vals'=>'',
            'relation_business'=>'4',
            'default_val'=>10,
            'unit'=>'min',
            'order'=>99
        ],
        //>>>
        //<<<会员配置
        //--注册配置
        'is_open_register' => [
            'name'=>'is open register',
            'type'=>'switch',
            'vals'=>['no','yes'],
            'relation_business'=>'4',
            'default_val'=>1,
            'order' =>1
        ],
        'register_check_way' => [
            'name'=>'register check way',
            'type'=>'checkbox',
            'vals'=>(object)['0'=>'none','1'=>'admin check','2'=>'email','3'=>'sms','4'=>'picture'],
            'relation_business'=>'4,7',
            'default_val'=>'2',
            'order' =>2
        ],
        'check_tips' => [
            'name'=>'admin check tips',
            'type'=>'text',
            'vals'=>'',
            'relation_business'=>'4',
            'default_val'=>'管理员审核中,需要1至7个工作日',
            'order' =>3
        ],
        'reg_captcha_type' => [
            'name'=>'图形验证码方式',
            'type'=>'radio',
            'vals'=>['1'=>'静态图片','2'=>'滑动图片'],
            'relation_business'=>'4',
            'default_val'=>'1',
            'order' =>4
        ],
        //--登录配置
        'is_open_login' => [
            'name'=>'开放登录',
            'type'=>'switch',
            'vals'=>['关闭','开启'],
            'relation_business'=>'4',
            'default_val'=>1,
            'link_fields'=>['login_check_way'],
            'order'=>5
        ],
        'login_check_way' => [
            'name'=>'登录验证方式',
            'type'=>'radio',
            'vals'=>['1'=>'用户名+密码','2'=>'用户名+密码+图片验证码','3'=>'手机号+短信验证码','4'=>'邮箱+邮件验证码'],
            'relation_business'=>'4',
            'default_val'=>'2',
            'order'=>6
        ],
        'login_captcha_type' => [
            'name'=>'图形验证码方式',
            'type'=>'radio',
            'vals'=>['1'=>'静态图片','2'=>'滑动图片'],
            'relation_business'=>'4',
            'default_val'=>'1',
            'order'=>7
        ],
        // 'login_error_times_limit' => [
        //  'name'=>'允许登录错误次数',
        //  'type'=>'number',
        //  'vals'=>'',
        //  'relation_business'=>'4',
        //  'default_val'=>5
        // ],
        // 'login_limit_time' => [
        //  'name'=>'禁止登录时间',
        //  'type'=>'number',
        //  'vals'=>'',
        //  'relation_business'=>'4',
        //  'default_val'=>10
        // ],
        //--其他安全设置
        'is_open_pay_password' => [
            'name'=>'是否开启支付密码',
            'type'=>'switch',
            'vals'=>['关闭','开启'],
            'relation_business'=>'4',
            'default_val'=>1,
            'order'=>8
        ],
        'retrieve_password_way' => [
            'name'=>'Retrieve password way',
            'type'=>'checkbox',
            'vals'=>['1'=>'artificial','2'=>'mobile','3'=>'email'],
            'relation_business'=>'4',
            'default_val'=>'1',
            'order'=>9
        ],
        //>>>会员配置
		//<!--积分配置行  ----verify_name验证场景名
		'is_open_credit'=> [
			'name'=>'是否开启积分',
			'type'=>'switch',
			'vals'=>['0'=>'关闭','1'=>'开启'],
			'default_val'=>'1',
			'verify_name'=>'is_open'
		],
		'is_shopping_interaction'=> [
			'name'=>'是否开启消费积分与互动积分',
			'type'=>'switch',
			'vals'=>['0'=>'关闭','1'=>'开启'],
			'default_val'=>'1',
			'verify_name'=>'shopping_interaction'
		],
		'credit_name'	=> [
			'name'=>'积分名称',
			'type'=>'text',
			'relation_business'=>'8',
			'default_val'=>'积分',
			'verify_name'=>'credit_name'
		],
		'credit_consumer_name'	=> [
			'name'=>'消费积分名称',
			'type'=>'text',
			'relation_business'=>'8',
			'default_val'=>'消费积分',
			'verify_name'=>'consumer_name'
		],
		'credit_interaction_name'	=> [
			'name'=>'互动积分名称',
			'type'=>'text',
			'relation_business'=>'8',
			'default_val'=>'互动积分',
			'verify_name'=>'interaction_name'
		],
		//消费送积分
		'credit_is_shopping'=> [
			'name'=>'是否开启购物赠送积分',
			'type'=>'switch',
			'vals'=>['0'=>'关闭','1'=>'开启'],
			'relation_business'=>'8',
			'default_val'=>'1',
			'verify_name'=>'open_shopping'
		],
		'credit_scale'=> [
			'name'=>'积分抵现比例',
			'type'=>'text',
			'relation_business'=>'8',
			'default_val'=>'100',
			'verify_name'=>'reg_credit_scale',
			'verify_name'=>'scale'
		],
		//注册送积分
		'credit_is_register'=> [
			'name'=>'注册赠送积分',
			'type'=>'number',
			'relation_business'=>'8',
			'default_val'=>'0',
			'relation_config'=>'is_open_credit',
			'verify_name'=>'open_register'
		],//不填表示不送积分
		//登录送积分
		'credit_is_login'=> ['name'=>'是否开启登录送积分','type'=>'switch','vals'=>['0'=>'关闭','1'=>'开启'],'relation_business'=>'8','default_val'=>'1','verify_name'=>'open_login'],
		'credit_login_send'=>['name'=>'单次登录赠送','type'=>'number','relation_business'=>'8','default_val'=>'10','verify_name'=>'credit_login_scene'],
		'credit_login_days' => ['name'=>'连续登录的天数','type'=>'number','default_val'=>'2','verify_name'=>'credit_days_scene'],//relation代表是同一组的
		'credit_login_extra' => ['name'=>'连续登录M送N积分','type'=>'number','default_val'=>'1','verify_name'=>'credit_extra_scene'],
		//签到送积分
		'credit_is_signin'=> ['name'=>'是否开启签到送积分','type'=>'switch','vals'=>['0'=>'关闭','1'=>'开启'],'relation_business'=>'8','default_val'=>'1','verify_name'=>'open_signin'],
		'credit_signin_send'=>['name'=>'单次签到赠送','type'=>'number','relation_business'=>'8','default_val'=>'10','verify_name'=>'signin_send'],
		'credit_signin_days'  => ['name'=>'连续签到的天数','type'=>'number','default_val'=>'2','verify_name'=>'signin_days'],//relation代表是同一组的
		'credit_signin_extra' => ['name'=>'连续签到M送N积分','type'=>'number','default_val'=>'1','verify_name'=>'signin_extra'],
	],

	//系统业务功能配置
	'business_config' => [
		'product_type' => ['id'=>'product_type','name'=>'产品类型','is_fixed'=>'1','is_require'=>'1'],
		'delivery_type' => ['id'=>'delivery_type','name'=>'发货方式','is_fixed'=>'1','is_require'=>'1'],
		'pay_type' => ['id'=>'pay_type','name'=>'交易方式','is_fixed'=>'1','is_require'=>'1'],
		'product_attr' => ['id'=>'product_attr','name'=>'产品规格','is_fixed'=>'0','is_require'=>'0']
	],
	//产品类型
	'product_type' => [
		'entity' => ['id'=>'entity','name'=>'实物','is_default'=>'1'],
		'invented' => ['id'=>'invented','name'=>'虚拟','is_default'=>'0']
	],
	//发货类型
	'delivery_type' => [
		'express' => ['id'=>'express','name'=>'快递','is_default'=>'1'],
		'offline_trade' => ['id'=>'offline_trade','name'=>'线下交易','is_default'=>'0']
	],
//	//支付类型
//	'pay_type' => [
//		'alipay' => ['id'=>'alipay','name'=>'支付宝','is_default'=>'1','is_config'=>'1'],
//		'balance' => ['id'=>'balance','name'=>'余额支付','is_default'=>'0','is_config'=>'0']
//	],
	//业务事件绑定的配置
	'event_list' => [
		'product_buy' => ['configs'=>'product_type'],
		'article_click' => ['configs'=>''],
	],
	//支付方式
// 	'pay_way' => [
// 		'1' => '支付宝',
// 		'2' => '微信支付',
// 		'3' => 'App微信支付',
// 		//'4' => '账户余额',
// 		//'5' => '易极付',
// 		//'6' => '线下支付',
// 		//'7' => '免支付',
// 		//'8' => '银联支付',
// 		//'9' => '通联支付个人版',
// 		//'10'=> '通联支付企业版'
// 	],
	//目前支持的支付方式
	'payment_type' =>[
		'1'=>[
			'id'=>'1',
			'type'=>'alipay',
			'name'=>'支付宝',
		],
		'2'=>[
			'id'=>'2',
			'type'=>'wechat_pc',
			'name'=>'微信支付'
		],
		'3'=>[
			'id'=>'3',
			'type'=>'wechat_app',
			'name'=>'App微信支付'
		]
	],
	//运费计算方式
	'sum_way' => [
		'1' => '件数',
		'2' => '重量',
		'3' => '体积'
	],
	//运送方式
	'shipping_type' => [
		'1' => [
			'name' => '快递',
			'tag' => 'express'
		],
		'2' => [
			'name' => 'EMS',
			'tag' => 'ems'
		],
		'3' => [
			'name' => '平邮',
			'tag' => 'post'
		],
		'4' => [
			'name' => '自提',
			'tag' => 'post'
		]
	],

	// 会员积分类型
	'credit_type' =>[
		'consumer' => ['id'=>1,'name'=>'消费积分'],
		'grade'    => ['id'=>2,'name'=>'等级积分'],
		'sign'     => ['id'=>3,'name'=>'签到积分'],
		'activity' => ['id'=>4,'name'=>'活动积分'],
		'development' => ['id'=>5,'name'=>'发展积分'],
		'coupon' => ['id'=>6,'name'=>'礼券兑换积分'],
		'register' => ['id'=>7,'name'=>'注册积分'],
		'login' => ['id'=>8,'name'=>'登录积分'],
	],
    //订单状态
    'order_status' => [
        '0' => '未付款',
        '1' => '已付款',
        '2' => '已发货',
        '3' => '已完成',
        '4' => '已取消',
        '5' => '已关闭',
        '6' => '售后中',
	],
    //消息类型
    'msg_type'=>[
        '1'=>'订单发货',
        '2'=>'订单签收',
        '3'=>'订单退款',
        '4'=>'活动',
    ],
    //售后状态
    'customer_status'=>[
        '1'=>'审核中',
        '2'=>'售后中',
        '3'=>'已拒绝',
        '4'=>'售后完成',
        '5'=>'已关闭',
    ],
    //消息订阅状态
    'prompt_type'=>[
        '1'=>'已付款',
        '2'=>'确认收货',
        '3'=>'取消订单',
        '4'=>'已评价',
        '5'=>'申请售后',
        '6'=>'取消售后',
        '7'=>'售后完成',
        '8'=>'修改信息',
        '9'=>'已发货',
        '10'=>'修改价格',
        '11'=>'退款',
        '12'=>'同意售后',
        '13'=>'拒绝售后',
        '14'=>'收到的评价',
        '15'=>'收到的回复',
        '16'=>'积分变动',
        '17'=>'等级变动',
        '18'=>'成长值变动',
        '19'=>'审核状态',
        '20'=>'数据被删',
	],
    //会员字段格式
    'field_format' => [
    	'custom' => [
    		'name' => '任意',
    		'default_val' =>'',
    		'placeholder' => '格式不限',
    		'error_msg' => '格式错误',
    		'regex' => '/.?/'
    	],
    	'tel' => [
    		'name' => '电话号码',
    		'default_val' => '',
    		'placeholder' => '格式：020-88888888/0757-88888888',
    		'error_msg' => '电话号码格式错误',
    		'regex' => '/\d{3}-\d{8}|\d{4}-\d{7}/',
    	],
    	'phone' => [
    		'name'=>'手机号码',
    		'default_val' =>'',
    		'placeholder'=>'格式：15812345678',
    		'error_msg'=>'手机号码格式错误',
    		'regex'=>'/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/'
    	],
    	'email' => [
    		'name' => '电子邮箱',
    		'default_val' => '',
    		'placeholder' => '格式：88888888@qq.com',
    		'error_msg' => '电子邮箱格式错误',
    		'regex' => '/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/'
    	],
    	'a1_' => [
    		'name' => '字母数字下划线',
    		'default_val' => '',
    		'placeholder' => '格式：abc_123',
    		'error_msg' => '只允许输入由字母、数字、下划线',
    		'regex' => '/^\w+$/'
    	],
    	'num' => [
    		'name' => '数字',
    		'default_val' => '',
    		'placeholder' => '格式：123',
    		'error_msg' => '只允许输入数字',
    		'regex' => '/^[0-9]*$/'
    	],
    	'alpha' => [
    		'name' => '字母',
    		'default_val' => '',
    		'placeholder' => '格式：abc',
    		'error_msg' => '只允许输入字母',
    		'regex' => '/^[a-zA-Z]*$/'
    	]
    ],
    'member_field_type' => [
        'text'      => '单行文本',
        'textarea'  => '多行文本',
        'select'    => '下拉列表',
        'radio'     => '单选按钮',
        'date'      => '下拉日历',
        'checkbox'  => '复选框',
        'image'     => '图片',
    ],
    //售后类型
    'cus_ser_types'=>[
        '1'=>'退款(未发货)',
        '2'=>'退款(已发货)',
        '3'=>'退货退款(已发货)',
        '4'=>'退款(已收货)',
        '5'=>'退货退款(已收货)',
        '6'=>'换货/返修(已收货)',
    ],
    //下单付款时限
    'deadline_type'=>[
        '0'=>'不限',
        '1'=>'15分钟',
        '2'=>'30分钟',
        '3'=>'1小时',
        '4'=>'3小时',
        '5'=>'6小时',
        '6'=>'12小时',
        '7'=>'1天',
        '8'=>'3天',
        '9'=>'7天',
        '10'=>'15天',
    ],
    //自动确认收货时限
    'autoconfirm_type'=>[
        '0'=>'不限',
        '1'=>'3天',
        '2'=>'7天',
        '3'=>'14天',
        '4'=>'21天',
        '5'=>'30天',
        '6'=>'60天',
        '7'=>'90天',
        '8'=>'180天',
    ],
    //取消订单理由
    'cancel_order'=>[
        1=>'我不想买了',
        2=>'信息填写错误，重新拍',
        3=>'卖家缺货',
        4=>'同城见面交易',
        5=>'付款遇到问题（如余额不足、不知怎样付款等）',
        6=>'拍错了',
        7=>'其他原因',
    ],

];
